package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.impl.InteractionReplyServiceImpl;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author 赵博凯
 * @since 2025-10-25
 */
@RestController
@RequestMapping("/replies")
@RequiredArgsConstructor
public class InteractionReplyController {

    private final InteractionReplyServiceImpl replyService;

    /**
     * 新增回答或评论
     */
    @PostMapping
    @ApiOperation("新增回答或评论")
    public void saveReply(@RequestBody ReplyDTO replyDTO) {
         replyService.saveReply(replyDTO);
    }

    /**
     * 分页查询回答或评论列表
     */

    @ApiOperation("分页查询回答或评论列表")
    @GetMapping("/page")
    public PageDTO<ReplyVO> queryReplyPage(ReplyPageQuery replyDTO) {

        return replyService.queryReplyPage(replyDTO,false);
    }



}